load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "tables",
    srcs = [
        "cache.go",
        "index.go",
        "mutation_checker.go",
        "partition.go",
        "state_remote.go",
        "tables.go",
    ],
    importpath = "github.com/pingcap/tidb/table/tables",
    visibility = ["//visibility:public"],
    deps = [
        "//errno",
        "//expression",
        "//kv",
        "//meta",
        "//meta/autoid",
        "//metrics",
        "//parser",
        "//parser/ast",
        "//parser/model",
        "//parser/mysql",
        "//parser/terror",
        "//sessionctx",
        "//sessionctx/binloginfo",
        "//sessionctx/stmtctx",
        "//sessionctx/variable",
        "//statistics",
        "//table",
        "//tablecodec",
        "//types",
        "//util",
        "//util/chunk",
        "//util/codec",
        "//util/collate",
        "//util/dbterror",
        "//util/generatedexpr",
        "//util/hack",
        "//util/logutil",
        "//util/mock",
        "//util/ranger",
        "//util/rowcodec",
        "//util/sqlexec",
        "//util/stringutil",
        "//util/tableutil",
        "//util/tracing",
        "@com_github_google_btree//:btree",
        "@com_github_pingcap_errors//:errors",
        "@com_github_pingcap_failpoint//:failpoint",
        "@com_github_pingcap_log//:log",
        "@com_github_pingcap_tipb//go-binlog",
        "@com_github_pingcap_tipb//go-tipb",
        "@com_github_tikv_client_go_v2//oracle",
        "@com_github_tikv_client_go_v2//tikv",
        "@org_uber_go_zap//:zap",
    ],
)

go_test(
    name = "tables_test",
    timeout = "short",
    srcs = [
        "cache_test.go",
        "export_test.go",
        "index_test.go",
        "main_test.go",
        "mutation_checker_test.go",
        "partition_test.go",
        "state_remote_test.go",
        "tables_test.go",
    ],
    embed = [":tables"],
    flaky = True,
    shard_count = 50,
    deps = [
        "//ddl",
        "//ddl/util/callback",
        "//domain",
        "//errno",
        "//infoschema",
        "//kv",
        "//meta/autoid",
        "//metrics",
        "//parser",
        "//parser/ast",
        "//parser/auth",
        "//parser/model",
        "//parser/mysql",
        "//session",
        "//sessionctx",
        "//sessionctx/binloginfo",
        "//sessionctx/stmtctx",
        "//sessionctx/variable",
        "//sessiontxn",
        "//store/helper",
        "//table",
        "//tablecodec",
        "//testkit",
        "//testkit/external",
        "//testkit/testsetup",
        "//types",
        "//util",
        "//util/codec",
        "//util/collate",
        "//util/dbterror",
        "//util/logutil",
        "//util/mock",
        "//util/rowcodec",
        "//util/stmtsummary",
        "@com_github_pingcap_errors//:errors",
        "@com_github_pingcap_failpoint//:failpoint",
        "@com_github_pingcap_tipb//go-binlog",
        "@com_github_prometheus_client_model//go",
        "@com_github_stretchr_testify//assert",
        "@com_github_stretchr_testify//require",
        "@com_github_tikv_client_go_v2//oracle",
        "@org_golang_google_grpc//:grpc",
        "@org_uber_go_goleak//:goleak",
        "@org_uber_go_zap//:zap",
    ],
)
